#!/bin/sh
### Apulis Platform command for train (CANN Version-20.2  C76)
## Set Ascend Log Level, if u wanna to print on terminal, you should open 'ASCEND_SLOG_PRINT_TO_STDOUT'. 
## But this set doesn't work for Modelarts Platform.
export ASCEND_SLOG_PRINT_TO_STDOUT=1
export ASCEND_GLOBAL_LOG_LEVEL=3
export TF_CPP_MIN_LOG_LEVEL=2        ## Tensorflow api print Log Config

currentDir=$(cd "$(dirname "$0")"; cd ..; pwd)
echo "===>>>Python boot file dir: ${currentDir}"

CurrentTime=`date "+%Y-%m-%d-%H-%M-%S"`

#start exec
python3 ${currentDir}/run.py \
        --config_file=${currentDir}/configs/speech2text/jasper5x3_LibriSpeech_nvgrad_masks_cache_1p.py \
        --mode=train \
        --enable_logs 2>&1 | tee ${CurrentTime}.log

if [ $? -eq 0 ] ;
then
    echo "Jasper train success"
else
    echo "Jasper train fail"
fi

